#ifndef	_MATCH_H_
#define _MATCH_H_

#include <cstddef> /* size_t */

struct Match
{
  	/* Index where the match starts on the reference string */ 
  	size_t refStart;
  	
    /* Index where the match starts on the input string */ 
  	size_t inputStart;
  	
  	/* match length */
  	size_t length;

	/* Number of bad chars (non A,C,G,T) in a chunk until inputStart */	
	size_t badChars;

	Match(size_t _refStart, size_t _inputStart, size_t _length = 0, size_t _badChars = 0);

	~Match();
	
    inline bool operator<(const Match& m) const;
	
	void print() const;
};

inline bool Match::operator<(const Match& m) const
{
  return ((refStart + length < m.refStart + m.length) || 
		 (((refStart + length) == (m.refStart + m.length)) && ((inputStart - badChars + length) < (m.inputStart - m.badChars + m.length))));
}

#endif /* _MATCH_H_ */
